﻿package core.ui.dialogs
{
    import core.enum.*;
    import core.event.*;
    import core.image.*;
    import core.ui.controls.*;

    public class WaterswirlDialog extends BitmapOperationDialogBase
    {
        var f:Filter;
        var b:Slidebar;
        var c:Slidebar;
        var cb:Checkbox;

        public function WaterswirlDialog(param1:Tuyitu)
        {
            super(param1, "rm_water_swirl", 240, 190, Action.WaterswirlFilter);
            this.f = new Filter();
            this.b = new Slidebar("rm_amount", 0, 100, 200, 10);
            this.b.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.b.x = 20;
            this.b.y = 35;
            addChild(this.b);
            this.c = new Slidebar("rm_size", 10, 500, 200, 100);
            this.c.addEventListener(SliderEvent.CHANGE, this.Change, false, 1, true);
            this.c.x = 20;
            this.c.y = 80;
            addChild(this.c);
            this.cb = new Checkbox("rm_horizontal");
            this.cb.addEventListener(ChangeEvent.CHANGE, this.Change, false, 1, true);
            this.cb.x = 20;
            this.cb.y = 125;
            addChild(this.cb);
            return;
        }// end function

        override public function Change(... args) : void
        {
            if (!locked)
            {
                bm.copyPixels(bc, bm.rect, bm.rect.topLeft);
                this.f.Waterswirl(bm, bc, this.b.value, this.c.value, this.cb.checked, selection, offset);
            }
            return;
        }// end function

    }
}
